import Vue from 'vue'
import App from './App.vue'
import Vant from 'vant'
import 'vant/lib/index.css'
import less from 'less'
// 引入amfe-flexible - 自动计算rem和px的百分比
import 'amfe-flexible'
// 引入reset样式表，去掉默认样式
import '@/assets/css/reset.css'

// 全局过滤器价格两位
Vue.filter('price', (price) => {
  let priceStr = '' + price
  if (priceStr.indexOf('.') > -1) {
    let arr = priceStr.split('.')
    return arr[0] + '.' + (arr[1] + '0').substr(0, 2)
  } else {
    return priceStr + '.00'
  }
})


Vue.use(Vant)
Vue.use(less)

Vue.config.productionTip = false

import router from '@/router'
import store from '@/store'

new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
